import { WrappedFormMethods } from 'rc-form';
import { PermissionFields, ICondition } from '@/plugins/form/types';

export class Props {
  public editSetting?= {
    key: 'gaea-datepicker', // TODO
    name: 'DatePicker',
    editors: [
      'Style',
      {
        field: 'name',
        text: 'Label',
        type: 'string',
        specialType: 'title'
      },
      {
        field: 'code',
        text: 'Code',
        type: 'string'
      },
      {
        field: 'required',
        text: 'Required',
        type: 'boolean'
      },
      // {
      //   field: 'disabled',
      //   text: 'Disabled',
      //   type: 'boolean',
      // },
      {
        field: 'placeholder',
        text: 'Placeholder',
        type: 'string'
      }
    ]
  };

  public style?: React.CSSProperties = {};
  public className?: string[] = ['customFormItem'];
  public name?: string = 'text'; // 空间名称
  public code = ''; // 控件编码
  public required?: boolean = false; // 是否必填
  public disabled?: boolean = false; // 是否禁用
  public placeholder?: string = '请输入'; // 控件提示语
  public visibleConditions?: ICondition[] = []; // 控件提示语
  public permission?: PermissionFields; // 控件提示语
  public renderMode: FormRenderModes | undefined = 'edit'; // 是否是预览模式
  public form?: WrappedFormMethods; // 控件提示语
  public value?: any;
  public unit?= '';
  public currency?= '';
  public explainText?= '';
  public warningText?= '';
  public layout?: string;
  public formValues?: IterateAny;
  public readonly?: boolean;
  public onChange?: any;
  public showNow?: boolean;
  public minDate?: string;
  public maxDate?: string;
  public options?: any[];
  public extra?: string;
}

export class State { }
